package com.nowcoder.community.service;/**
 * 功能描述
 *
 * @author 21775
 * @date 2022/09/25  21:56
 */

import com.nowcoder.community.entity.DiscussPost;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.SearchResultMapper;
import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;
import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.core.query.SearchQuery;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *@ClassName ElasticSearchService
 *@Description TODO 搜索帖子
 *@Author 21775
 *@Date 2022/9/25 21:56
 *@Version 1.0
 */
public interface ElasticSearchService {
    public void saveDiscussPost(DiscussPost post);

    public void deleteDiscussPost(int id);

    public Page<DiscussPost> searchDiscussPost(String keyword, int current, int limit);
}
